package com.wood.life.controller;

import com.night.common.entity.ResultVo;
import com.night.common.entity.life.Goods;
import com.night.common.entity.life.Order;
import com.wood.life.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * author: dz
 * 2022-10-20-18:58
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    OrderService orderService;


    @RequestMapping("/add")
    public ResultVo add(@RequestBody Goods goods) {
        return orderService.insert(goods);
    }

    @RequestMapping("/getById")
    public Order getById(Integer id) {
        System.out.println(orderService.getById(id));
        return orderService.getById(id);
    }
}
